import request from '../request/request'
 
/**
 * 队伍（分页）
 * @param {*} data 
 */
export function getTeamList(data) {
	return request({
		url: '/api/team/list/page',
		method: 'post',
		data
		
	})
}
/**
 * 创建队伍
 * @param {*} data 
 */
export function createTeam(data) {
	return request({
		url: '/api/team/create',
		method: 'post',
		data
		
	})
}
/**
 * 已创建队伍
 * @param {*} data 
 */
export function hasCreatedTeam(data) {
	return request({
		url: '/api/team/list/my/create',
		method: 'post',
		data
		
	})
}
/**
 * 解散队伍
 * @param {*} data 
 */
export function deleteTeam(teamId) {
	return request({
		url: `/api/team/delete?id=${teamId}`,
		method: 'delete'
		
		
	})
}
/**
 * 退出队伍
 * @param {*} data 
 */
export function quitTeam(data) {
	return request({
		url: '/api/team/quit',
		method: 'post',
		data
		
	})
}
/**
 * 已加入队伍
 * @param {*} 
 */
export function hasJoinTeam() {
	return request({
		url: '/api/team/hasJoin',
		method: 'get',
		
		
	})
}
/**
 * 编辑队伍
 * @param {*} data 
 */
export function updateTeam(data) {
	return request({
		url: '/api/team/update',
		method: 'post',
		data
		
	})
}
/**
 * 查找队伍
 * @param {*} data 
 */
export function searchTeam(data) {
	return request({
		url: '/api/team/list',
		method: 'post',
		data
		
	})
}
/**
 * 加入队伍
 * @param {*} data 
 */
export function joinTeam(data) {
	return request({
		url: '/api/team/join',
		method: 'post',
		data
		
	})
}
/**
 * 发送订阅消息
 * @param {*} data 
 */
export function sendMsg(userId,teamId) {
	return request({
		url: '/api/wx/msg/send/'+userId+'&'+teamId,
		method: 'post'
		
		
	})
}
/**
 * 获取未读消息
 * @param {*} data 
 */
export function getUnReadMsg() {
	return request({
		url: '/api/ws/getUnReadMsg',
		method: 'get'
		
		
	})
}
/**
 * 发送组队邀请
 */
export function sendInvitation(data){
	return request({
		url:'/api/ws/sendInvitation',
		method:'post',
		data
	})

}
/**
 * 标记已读消息
 */
export function markReadMsg(teamId){
	return request({
		url:`/api/ws/markMsg/${teamId}`,
		method:'get'
		
	})

}
